﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TeenyGrab.Interfaces;
using TeenyGrab.Objects;
using System.Drawing;
using TeenyGrab.Windows;

namespace TeenyGrab.Inputs
{
    [Serializable]
    public class BlankInput : IInput
    {
        public int Width { get; set; }
        public int Height { get; set; }
        public Color Color { get; set; }
        public bool Configurable { get { return true; } set { } }

        public string Name { get { return "Blank"; } set { } }

        public string Description { get { return "A solid color."; } set { } }

        public BlankInput()
        {
            Color = Color.Black;
            Width = 100;
            Height = 100;
        }

        public void Configure()
        {
            var configure = new ConfigureBlankInputWindow(this);
            configure.ShowDialog();
        }

        public ImageObject Get()
        {
            var bitmap = new Bitmap(Width, Height);
            var graphics = Graphics.FromImage(bitmap);
            graphics.Clear(Color);

            return new ImageObject()
            {
                Image = (Image)bitmap,
            };
        }
    }
}
